# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-nassl
_pkgname=nassl
pkgver=5.3.0
pkgrel=1
epoch=1
pkgdesc='Experimental Python wrapper for OpenSSL.'
arch=('x86_64' 'aarch64')
url='https://github.com/nabla-c0d3/nassl'
license=('GPL')
depends=('python')
makedepends=('openssl' 'openssl-1.0' 'zlib' 'python-setuptools' 'python-invoke'
             'python-pipenv')
source=("https://github.com/nabla-c0d3/nassl/archive/$pkgver.tar.gz")
sha512sums=('a2c3e434639b41574886497c099f96398a4c591bbab42d10ee023f40ebee047fdd2f3f2229095642345f1309eab74f98654eef0feae966f7e5b9f9d0b8e08bd7')

build() {
  cd "$_pkgname-$pkgver"

  pipenv install --dev

  invoke build.zlib
  invoke build.legacy-openssl
  invoke build.modern-openssl

  python setup.py build_ext -i -I/usr/include/openssl-1.0/ \
    -I/usr/include/openssl/

  python setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

